<%--
  Created by IntelliJ IDEA.
  User: wowud
  Date: 2025/3/12
  Time: 11:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="1">
    <h2>用户管理</h2>
    <a href="${pageContext.request.contextPath}/addUser.jsp">新增用户</a>
    <tr>
        <td>账户</td>
        <td>角色</td>
        <td>性别</td>
        <td>年龄</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${users}" var="user">
        <tr>
            <td>${user.username}</td>
            <td>${user.role==0?'管理员':'普通用户'}</td>
            <td>${user.sex}</td>
            <td>${user.age}</td>
            <td><a href="${pageContext.request.contextPath}/user/remove?id=${user.id}">删除</a></td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
